-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add BedrockEmbeddingModel for Nova, Cohere and Titan endpoints
#4008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
BedrockEmbeddingModel for Nova, Cohere and Titan endpoints
| str(response_body), | ||
| ) | ||
|
|
||
| return EmbeddingResult( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets simplify this method by returning only the embeddings + tokens + in some cases the response ID, and then build the EmbeddingResult where we call parse_response. Right now when we combine single-document runs, we deconstruct the individual EmbeddingResults and turn them into one combined one anyway, so let's skip the intermediate EmbeddingResult. That also means we no longer have to pass inputs, model_name etc into this method anymore.
This comment was marked as outdated.
This comment was marked as outdated.
… model settings examples
… for embedding files
…truncation strategies and supported purposes
- Removed the mock_vcr_botocore_content_length fixture to simplify VCR handling. - Added 'x-amzn-bedrock-' to ALLOWED_HEADER_PREFIXES for Bedrock embeddings. - Updated content-length header in serialize function to match decompressed body size. - Adjusted input_tokens in RequestUsage for various Bedrock embedding tests to reflect actual token counts. - Changed model names to include versioning for consistency. - Increased embedding dimensions in test assertions for Bedrock and Nova models.
Pre-Review Checklist
make formatandmake typecheck.Pre-Merge Checklist